import 'package:flexible/flexible.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_1_25_0/test/asset_audio_player_demo.dart';
import 'package:flutter_app_1_25_0/test/data_item.dart';
import 'package:flutter_app_1_25_0/test/report_card.dart';
import 'package:flutter_app_1_25_0/test/rich_data_item.dart';
import 'package:flutter_app_1_25_0/test/stream_builder_demo.dart';
import 'package:flutter_app_1_25_0/test/stream_demo.dart';
import 'package:flutter_app_1_25_0/test/text_underline.dart';
import 'package:flutter_app_1_25_0/testWidget/cell_demo.dart';
import 'package:flutter_app_1_25_0/testWidget/icon.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ScreenFlexibleInheritedWidget(
      baseWidgetWidth: 1200,
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
            platform: TargetPlatform.iOS,
            primaryColor: Colors.white,
            accentColor: Color(0xff302B34),
            splashColor: Colors.transparent,
            fontFamily: 'Microsoft Yahei'),
        home: ScreenFlexibleInheritedWidget(
          baseWidgetWidth: 1200,
          child: AssetAudioPlayerDemoPage(title: 'Flutter Demo Home Page'),
          // child: RichDataItemPage(title: 'Flutter Demo Home Page'),
        ),
        // home: DataItemPage(title: 'Flutter Demo Home Page'),
        // home: StreamBuilderHomePage(title: 'Flutter Demo Home Page'),
        // home: IconPage(title: 'Flutter Demo Home Page'),
        // home: StreamHomePage(title: 'Flutter Demo Home Page'),
        // home: TextUnderlinePage(title: 'Flutter Demo Home Page'),
        // home: ReportPage(title: 'Flutter Demo Home Page'),
        // home: MyInputPage(title: 'Flutter Demo Home Page'),
        // home: MyHomePage(title: 'Flutter Demo Home Page'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
